import App from '../App'
import login from 'page/login/login'
const home = r => require.ensure([], () => r(require('../page/home/home')), 'home')
const forget = r => require.ensure([], () => r(require('../page/forget/forget')), 'forget')
const profile = r => require.ensure([], () => r(require('../page/profile/profile')), 'profile')
const info = r => require.ensure([], () => r(require('../page/profile/children/info')), 'info')
const service = r => require.ensure([], () => r(require('../page/service/service')), 'service')
const setusername = r => require.ensure([], () => r(require('../page/profile/children/setusername')), 'setusername')
const address = r => require.ensure([], () => r(require('../page/profile/children/children/address')), 'address')
const add = r => require.ensure([], () => r(require('../page/profile/children/children/children/add')), 'add')
const addDetail = r => require.ensure([], () => r(require('../page/profile/children/children/children/children/addDetail')), 'addDetail')
const vipcard = r => require.ensure([], () => r(require('../page/vipcard/vipcard')), 'vipcard')
const useCart = r => require.ensure([], () => r(require('../page/vipcard/children/useCart')), 'useCart')
const confirmOrder = r => require.ensure([], () => r(require('../page/confirmOrder/confirmOrder')), 'confirmOrder')
const payment = r => require.ensure([], () => r(require('../page/confirmOrder/children/payment')), 'payment')
const vipDescription = r => require.ensure([], () => r(require('../page/vipcard/children/vipDescription')), 'vipDescription')
const download = r => require.ensure([], () => r(require('../page/download/download')), 'download')
const balance = r => require.ensure([], () => r(require('../page/balance/balance')), 'balance')
const detail = r => require.ensure([], () => r(require('../page/balance/children/detail')), 'detail')
const invoiceRecord = r => require.ensure([], () => r(require('../page/vipcard/children/invoiceRecord')), 'invoiceRecord')
const benefit = r => require.ensure([], () => r(require('../page/benefit/benefit')), 'benefit')
const hbDescription = r => require.ensure([], () => r(require('../page/benefit/children/hbDescription')), 'hbDescription')
const hbHistory = r => require.ensure([], () => r(require('../page/benefit/children/hbHistory')), 'hbHistory')
const coupon = r => require.ensure([], () => r(require('../page/benefit/children/coupon')), 'coupon')
const points = r => require.ensure([], () => r(require('../page/points/points')), 'points')
const pointsDetail = r => require.ensure([], () => r(require('../page/points/children/detail')), 'pointsDetail')
const city = r => require.ensure([], () => r(require('../page/city/city')), 'city')
const msite = r => require.ensure([], () => r(require('../page/msite/msite')), 'msite')
const search = r => require.ensure([], () => r(require('../page/search/search')), 'search')
const food = r => require.ensure([], () => r(require('../page/food/food')), 'food')
const shop = r => require.ensure([], () => r(require('../page/shop/shop')), 'shop')
const invoice = r => require.ensure([], () => r(require('../page/confirmOrder/children/invoice')), 'invoice')
const remark = r => require.ensure([], () => r(require('../page/confirmOrder/children/remark')), 'remark')
const chooseAddress = r => require.ensure([], () => r(require('../page/confirmOrder/children/chooseAddress')), 'chooseAddress')
const addAddress = r => require.ensure([], () => r(require('../page/confirmOrder/children/children/addAddress')), 'addAddress')
const searchAddress = r => require.ensure([], () => r(require('../page/confirmOrder/children/children/children/searchAddress')), 'searchAddress')
const userValidation = r => require.ensure([], () => r(require('../page/confirmOrder/children/userValidation')), 'userValidation')
const shopDetail = r => require.ensure([], () => r(require('../page/shop/children/shopDetail')), 'shopDetail')
const shopSafe = r => require.ensure([], () => r(require('../page/shop/children/children/shopSafe')), 'shopSafe')
const foodDetail = r => require.ensure([], () => r(require('../page/shop/children/foodDetail')), 'foodDetail')
const order = r => require.ensure([], () => r(require('../page/order/order')), 'order')
const orderDetail = r => require.ensure([], () => r(require('../page/order/children/orderDetail')), 'orderDetail')
const questionDetail = r => require.ensure([], () => r(require('../page/service/children/questionDetail')), 'questionDetail')
const exchange = r => require.ensure([], () => r(require('../page/benefit/children/exchange')), 'exchange')
const commend = r => require.ensure([], () => r(require('../page/benefit/children/commend')), 'commend')
/*const login = r => require.ensure([], () => r(require('../page/login/login')), 'login')*/
// Vue.use(Router)

export default [{
  path:'/',
  component:App,
  children:[
    {
      path: '',
      redirect: '/home'
    },
    {
      path: '/home',
      component: home
    },
    {
      path: '/city/:cityid',
      component: city
    },
    {
      path: '/login',
      component: login
    },
    {
      path: '/forget',
      component: forget
    },
    {
      path:'/profile',
      component:profile,
      children:[
        {
        path:'info',
        component: info,
          children:[{
            path:'address',
            component:address,
            children:[{
              path:'add',
              component:add,
              children:[{
                path:'addDetail',
                component:addDetail
              }]
            }]
          } ]
        },
        {
          path:'setusername',
          component: setusername
        },
        {
          path: 'service',
          component: service
        }
      ]
    },
    {
      path:'/vipcard',
      component:vipcard,
      children:[
        {
          path:'vipDescription',
          component:vipDescription
        },
        {
          path: 'invoiceRecord',
          component: invoiceRecord,
        },
        {
          path:'useCart',
          component:useCart
        }
      ]
    },
    {
      path: 'service',
      component: service,
      children:[
        {
          path:'questionDetail',
          component:questionDetail
        }
      ]
    },
    {
      path:'/confirmOrder',
      component:confirmOrder,
      children:[
        {
          path: 'payment',
          component: payment
        },
        {
          path: 'invoice',
          component: invoice
        },
        {
          path:'remark',
          component:remark
        },
        {
          path: 'userValidation',
          component: userValidation,
        },
        {
          path:'chooseAddress',
          component:chooseAddress,
          children:[
            {
              path:'addAddress',
              component:addAddress,
              children:[
                {
                  path:'searchAddress',
                  component:searchAddress
                }
              ]
            },

          ]
        }
      ]
    },
    {
      path:'balance',
      component:balance,
      children: [
        {
        path: 'detail',
        component: detail
       }
      ]
    },
    {
      path:'benefit',
      component:benefit,
      children:[
        {
          path:'hbDescription',
          component:hbDescription
        },
        {
          path:'coupon',
          component:coupon
        },
        {
        path:'hbHistory',
          component:hbHistory
        },
        {
          path:'exchange',
          component:exchange
        },
        {
          path: 'commend', //推荐有奖
          component: commend,
        }
      ]
    },
    {
      path: 'download',
      component: download
    },
    {
      path:'points',
      component:points,
      children:[{
        path: 'detail',
        component: pointsDetail
      }]
    },
    {
      path: '/msite',
      component: msite,
      meta: { keepAlive: true },
    },
    {
      path:'/search/:geohash',
      component: search
    },
    {
      path:'/search',
      component: search
    },
    {
      path: '/food',
      component: food
    },
    {
      path:'/shop',
      component:shop,
      children:[
        {
          path:'shopDetail',
          component:shopDetail,
          children:[
            {
              path:'shopSafe',
              component:shopSafe
            }
          ]
        },
        {
          path: 'foodDetail',
          component: foodDetail,
        }
      ]
    },
    {
      path:'/order',
      component:order,
      children:[{
        path:'orderDetail',
        component:orderDetail
      }]
    }
  ]
}]

